package com.hotel.service.Impl;

import com.hotel.dao.FoodDao;
import com.hotel.dao.FoodTypeDao;
import com.hotel.factory.BeanFactory;
import com.hotel.pojo.FoodType;
import com.hotel.service.FoodTypeService;
import java.util.List;

/**
 * Created by LinYaTing on 2018/11/24 0:14
 */
public class FoodTypeServiceImpl implements FoodTypeService {

    //工厂创建对象
    private FoodTypeDao foodTypeDao = BeanFactory.getInstance("foodTypeDao",FoodTypeDao.class );

    @Override
    public void save(FoodType foodType) {
        foodTypeDao.save(foodType);
    }

    @Override
    public void delete(int id) {
            foodTypeDao.delete(id);
    }

    @Override
    public void update(FoodType foodType) {
        foodTypeDao.update(foodType);
    }

    @Override
    public List<FoodType> findAll() {
        return foodTypeDao.findAll();
    }

    @Override
    public List<FoodType> findList(String typeName) {
        return foodTypeDao.findList(typeName);
    }

    @Override
    public FoodType findFoodTypeById(int id) {
        return foodTypeDao.findFoodTypeById(id);
    }

    @Override
    public List<FoodType> findNameAndId() {
        return foodTypeDao.findNameAndId();
    }
}
